import axios from 'axios'

const ERR_OK = 0
const ERR_OK_KUWO = 200

export const get = (url) => {
  return (params) => {
    return axios.get(url, {
      params
    }).then((res) => {
      const { code, data } = res.data
      if (code === ERR_OK || code === ERR_OK_KUWO) {
        return data
      }
    }).catch((e) => {
      console.log(e)
    })
  }
}
